package JDBC;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class SQLdelete {
    public void func(String name, Connection connection)throws SQLException{
        String sql="delete from student where name=?";
        PreparedStatement statement=connection.prepareStatement(sql);
        statement.setString(1,name);
        int n=statement.executeUpdate();
        System.out.print("操作执行的行数为");
        System.out.println(n);
        statement.close();
    }
}
